//
//  MNDUserCenterViewController.m
//  miniwangdai2
//
//  Created by Steven.Yung on 2017/3/28.
//  Copyright © 2017年 谭谭伟. All rights reserved.
//

#import "MNDUserCenterViewController.h"
#import "MNDUserCenterTopSectionCell.h"
#import "MNDUserCenterTopSectionModel.h"

@interface MNDUserCenterViewController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, weak) UITableView *tableView;

@end

@implementation MNDUserCenterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    MNDUserCenterTopSectionCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    
    return cell;
}

#pragma mark - getter

- (UITableView *)tableView {
    
    if (!_tableView) {
        UITableView *tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
        [self.view addSubview:tableView];
        
        [tableView registerClass:[MNDUserCenterTopSectionCell class] forCellReuseIdentifier:@"cell"];
        
        _tableView = tableView;
    }
    
    return _tableView;
}

@end
